<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.util.UUID"%>
<%@ include file="/WEB-INF/pages/common/taglib.jsp" %>
<%
    String gridId = UUID.randomUUID().toString();
    request.setAttribute("gridId", gridId);
%>
<script type="text/javascript">
$(function () {
	$("#excBt").click(function(){
		var script=$("#scriptView").val();
		$.post(ctx+"/scriptAction/parseGroovyScript.do",{
			script:script
		},function(data){
			console.log(data);
			if(data.success){
				$("#resultView").val(data.obj);
			}else{
				$("#resultView").val(data.msg);
			}
		},"json");
		
	});
});
</script>
<form class="am-form">
<fieldset>
    <legend>表单标题</legend>
    <div class="am-form-group">
      <label>脚本内容</label>
      <textarea id="scriptView" style="height: 120px"></textarea>
    </div>
    <div class="am-form-group">
    	<button type="button" class="am-btn am-btn-primary"  id="excBt">执行</button>
    </div>
    <div class="am-form-group">
    	<label>输出结果:</label>
	      <textarea id="resultView"></textarea>
    </div>
</fieldset>
</form>